<?php
abstract class Module {
	private $view = null;
	
	protected function render($view) {
		if ($this->view == null) $this->view = new Views();
		$this->view->clearContent();
		$this->addContent($view);
	}
	
	protected function addContent($view) {
		if ($this->view == null) $this->view = new Views();
		$this->view->addContent($view);
	}
	
	protected function addBlock($view) {
		if ($this->view == null) $this->view = new Views();
		$this->view->addBlock($view);
	}
	
	protected function set($n,$v) {
		if ($this->view == null) $this->view = new Views();
		$this->view->setVar($n,$v);
	}
	
	public function _output() {
		if ($this->view == null) {
			$this->view = new Views();
		}
		$this->view->render();
	}
}
